package com.cenluan.ext.beetl.format;

import java.io.UnsupportedEncodingException;
import java.net.URLEncoder;

import org.beetl.core.Format;

/**
 * url转义格式
 * 
 * @author peak
 * 
 */
public class UrlFormat implements Format {

	public Object format(Object data, String pattern) {
		try {
			return URLEncoder.encode((String) data, "UTF-8");
		} catch (UnsupportedEncodingException e) {
			throw new RuntimeException(e);
		}
	}

}
